package eduware.gui;

import java.awt.Polygon;

/**
 * Contains helper methods for the GUI.
 * 
 * @author Florian Bausch
 * 
 */
public class GUIUtils {

	/**
	 * creates a speech bubble shaped polygon for the given width and height. -
	 * for positioning on the right hand side
	 * 
	 * @param width
	 *            An int.
	 * @param height
	 *            An int.
	 * @return The speech bubble shaped polygon.
	 */
	public static Polygon getSpeechBubbleShape(int width, int height) {
		Polygon poly = new Polygon();
		poly.addPoint(20, 0);
		poly.addPoint(width - 20, 0);
		poly.addPoint(width, 20);
		poly.addPoint(width, height - 60);
		poly.addPoint(width - 20, height - 40);
		poly.addPoint(60, height - 40);
		poly.addPoint(0, height);
		poly.addPoint(20, height - 40);
		poly.addPoint(0, height - 60);
		poly.addPoint(0, 20);
		return poly;
	}

	/**
	 * creates a speech bubble shaped polygon for the given width and height.
	 * For positioning on the lefthand side
	 * 
	 * @param width
	 *            An int.
	 * @param height
	 *            An int.
	 * @return The speech bubble shaped polygon.
	 */
	public static Polygon getSpeechBubbleShape2(int width, int height) {
		Polygon poly = new Polygon();
		poly.addPoint(20, 0);
		poly.addPoint(width - 20, 0);
		poly.addPoint(width, 20);
		poly.addPoint(width, height - 60);
		poly.addPoint(width - 20, height - 40);
		poly.addPoint(width, height);
		poly.addPoint(width - 60, height - 40);
		poly.addPoint(20, height - 40);
		poly.addPoint(0, height - 60);
		poly.addPoint(0, 20);
		return poly;
	}

}
